package com.pms.actions;

import java.util.Hashtable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.pms.framework.Action;
 

public class LoginDataAction implements Action {

	public void execute(HttpServletRequest request, HttpServletResponse response) {
		Hashtable error = (Hashtable) request.getAttribute("error");
	      
		    
			if(error.size() > 0) 
			{
				if(error.containsKey("InvalidLogin") || error.containsKey("illegalAccess")) 
				{
			
					request.setAttribute("nextPageToken", "needLogin");
					request.setAttribute("plainPage", "TRUE");
					return;
				} else {
					request.setAttribute("nextPageToken", "failure");
					return;
				}
			}
		request.setAttribute("plainPage", "TRUE");
		request.setAttribute("nextPageToken", "success");
	}
}
